﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BLL;

public partial class User_CTIReg_CTICompany : System.Web.UI.Page
{
    UserBean bllUser = new UserBean();
    WebUtility bllUtility = new WebUtility();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            WebUtility.BindList("行业属性", ddl_Vocation);
        }
    }

    protected void btn_Submit_Click(object sender, ImageClickEventArgs e)
    {
        string accountNO = Request.QueryString["AccountNO"].ToString();
        string name = this.realName.Text;
        string email = this.email.Text;
        string phoneNO = this.phone.Text;
        string vocation = this.ddl_Vocation.SelectedIndex != 0 ? this.ddl_Vocation.SelectedItem.Text : "";
        string address = this.email.Text;
        string zipCode = this.txt_ZipCode.Text;

        int count = bllUser.AddCustom_CTIUser(Guid.NewGuid().ToString(), accountNO, name, email, phoneNO, vocation, address, zipCode);

        if (count <= 0)
        {
            bllUtility.AlertMsg("用户信息完善失败！");
            Response.Redirect(WebUtility.getWebRootPath() + "/Login/Login.aspx");
            return;
        }
        else
        {
            bllUtility.AlertMsg("用户信息成功添加！");
        }
    }
}
